import contextlib


@contextlib.contextmanager
def file_open(filename):
    print("file open")
    yield {}
    print("file end")


if __name__ == '__main__':
    with file_open("leo.txt") as f:
        print("file processing")